/**
   A class to process names.
*/
public class Names
{
   /**
      Turns a name "First Last" into a name "Last, First"
      @param firstLast a name such as "Harry Smith", with a space separating
      the first and last name.
      @return a name such as "Smith, Harry", with the last name followed by
      a comma, a space, and the first name.
   */
   public String getLastFirst(String firstLast)
   {
      int l = firstLast.length();
      String s = "",ss = "";
      for(int i = 0;i<l;i++){
         if(firstLast.charAt(i)==32){
            for(int j = i+1;j<l;j++){
               ss=ss+firstLast.charAt(j);
            }
            break;
         }
         s=s+firstLast.charAt(i);
      }
      ss=ss+','+' '+s;
      return ss;
      
   }
}